home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-09-26 | 8.9 KB | [TEXT/MMCC] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Mon Sep 26 02:33:31 1994, modified Mon Sep 26 02:33:31 1994, creator 'MMCC', type ASCII, 8184 bytes "Binomial.c" , at 0x2078 714 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MMCC] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 42 69 6e 6f 6d 69 | 61 6c 2e 63 00 00 00 00 |..Binomi|al.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 1f f8 00 | 00 02 ca aa ac 1b bb aa |........|........|
|00000060| ac 1b bb 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 91 43 00 00 |........|.....C..|
|00000080| 2f 2a 0d 42 69 6e 6f 6d | 69 61 6c 2e 63 0d 43 6f |/*.Binom|ial.c.Co|
|00000090| 70 79 72 69 67 68 74 20 | 28 63 29 20 31 39 39 30 |pyright |(c) 1990|
|000000a0| 2c 31 39 39 31 2c 31 39 | 39 32 2c 31 39 39 34 20 |,1991,19|92,1994 |
|000000b0| 44 65 6e 69 73 20 47 2e | 20 50 65 6c 6c 69 0d 0d |Denis G.| Pelli..|
|000000c0| 56 61 72 69 6f 75 73 20 | 72 6f 75 74 69 6e 65 73 |Various |routines|
|000000d0| 20 74 68 61 74 20 64 65 | 61 6c 20 77 69 74 68 20 | that de|al with |
|000000e0| 42 69 6e 6f 6d 69 61 6c | 20 73 74 61 74 69 73 74 |Binomial| statist|
|000000f0| 69 63 73 2c 20 69 6e 63 | 6c 75 64 69 6e 67 20 67 |ics, inc|luding g|
|00000100| 65 6e 65 72 61 74 69 6e | 67 20 72 61 6e 64 6f 6d |eneratin|g random|
|00000110| 0d 73 61 6d 70 6c 65 73 | 20 61 6e 64 20 63 6f 6d |.samples| and com|
|00000120| 70 75 74 69 6e 67 20 63 | 6f 6e 66 69 64 65 6e 63 |puting c|onfidenc|
|00000130| 65 20 69 6e 74 65 72 76 | 61 6c 73 2e 0d 0d 54 68 |e interv|als...Th|
|00000140| 69 73 20 66 69 6c 65 20 | 63 6f 6e 74 61 69 6e 73 |is file |contains|
|00000150| 20 74 77 6f 20 67 65 6e | 65 72 61 74 69 6f 6e 73 | two gen|erations|
|00000160| 20 6f 66 20 72 6f 75 74 | 69 6e 65 73 20 74 68 61 | of rout|ines tha|
|00000170| 74 20 67 65 6e 65 72 61 | 74 65 20 63 6f 6e 66 69 |t genera|te confi|
|00000180| 64 65 6e 63 65 0d 69 6e | 74 65 72 76 61 6c 73 2e |dence.in|tervals.|
|00000190| 20 54 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 72 6f | The ori|ginal ro|
|000001a0| 75 74 69 6e 65 73 20 42 | 69 6e 6f 6d 69 61 6c 55 |utines B|inomialU|
|000001b0| 70 70 65 72 42 6f 75 6e | 64 20 61 6e 64 20 42 69 |pperBoun|d and Bi|
|000001c0| 6e 6f 6d 69 61 6c 4c 6f | 77 65 72 42 6f 75 6e 64 |nomialLo|werBound|
|000001d0| 20 61 72 65 0d 6f 6c 64 | 2c 20 62 75 74 20 61 72 | are.old|, but ar|
|000001e0| 65 20 6d 6f 72 65 20 72 | 6f 62 75 73 74 2e 20 54 |e more r|obust. T|
|000001f0| 68 65 20 6e 65 77 20 72 | 6f 75 74 69 6e 65 73 20 |he new r|outines |
|00000200| 61 72 65 20 62 61 73 65 | 64 20 6f 6e 20 61 20 4e |are base|d on a N|
|00000210| 75 6d 65 72 69 63 61 6c | 20 52 65 63 69 70 65 73 |umerical| Recipes|
|00000220| 20 69 6e 20 43 0d 72 6f | 75 74 69 6e 65 20 74 6f | in C.ro|utine to|
|00000230| 20 63 6f 6d 70 75 74 65 | 20 74 68 65 20 69 6e 63 | compute| the inc|
|00000240| 6f 6d 70 6c 65 74 65 20 | 62 65 74 61 20 66 75 6e |omplete |beta fun|
|00000250| 63 74 69 6f 6e 2e 20 54 | 68 65 20 6e 65 77 20 72 |ction. T|he new r|
|00000260| 6f 75 74 69 6e 65 73 20 | 61 64 64 20 6c 69 74 74 |outines |add litt|
|00000270| 6c 65 20 74 6f 0d 74 68 | 65 20 6f 6c 64 20 72 6f |le to.th|e old ro|
|00000280| 75 74 69 6e 65 73 2c 20 | 61 6e 64 20 72 65 71 75 |utines, |and requ|
|00000290| 69 72 65 20 74 68 65 20 | 4e 75 6d 65 72 69 63 61 |ire the |Numerica|
|000002a0| 6c 20 52 65 63 69 70 65 | 73 20 69 6e 20 43 2c 20 |l Recipe|s in C, |
|000002b0| 73 6f 20 49 20 63 6f 6d | 6d 65 6e 74 65 64 20 74 |so I com|mented t|
|000002c0| 68 65 6d 0d 6f 75 74 2e | 20 0d 0d 41 6c 73 6f 20 |hem.out.| ..Also |
|000002d0| 73 65 65 3a 20 43 68 69 | 53 71 75 61 72 65 2e 63 |see: Chi|Square.c|
|000002e0| 2c 20 45 78 70 6f 6e 65 | 6e 74 69 61 6c 2e 63 2c |, Expone|ntial.c,|
|000002f0| 20 4e 6f 72 6d 61 6c 2e | 63 2c 20 55 6e 69 66 6f | Normal.|c, Unifo|
|00000300| 72 6d 2e 63 0d 0d 48 49 | 53 54 4f 52 59 3a 0d 31 |rm.c..HI|STORY:.1|
|00000310| 2f 35 2f 39 31 20 41 64 | 64 65 64 20 6e 65 77 20 |/5/91 Ad|ded new |
|00000320| 62 69 6e 6f 6d 69 61 6c | 20 72 6f 75 74 69 6e 65 |binomial| routine|
|00000330| 73 2e 20 54 68 65 73 65 | 20 72 6f 75 74 69 6e 65 |s. These| routine|
|00000340| 73 20 6d 61 79 20 62 65 | 20 0d 09 09 63 6f 6d 6d |s may be| ...comm|
|00000350| 65 6e 74 65 64 20 6f 75 | 74 20 62 79 20 73 65 74 |ented ou|t by set|
|00000360| 74 69 6e 67 20 4e 45 57 | 5f 42 49 4e 4f 4d 49 41 |ting NEW|_BINOMIA|
|00000370| 4c 20 74 6f 20 7a 65 72 | 6f 2e 0d 31 2f 37 2f 39 |L to zer|o..1/7/9|
|00000380| 31 20 52 65 77 72 6f 74 | 65 20 42 69 6e 6f 6d 69 |1 Rewrot|e Binomi|
|00000390| 61 6c 55 70 70 65 72 42 | 6f 75 6e 64 20 26 20 42 |alUpperB|ound & B|
|000003a0| 69 6e 6f 6d 69 61 6c 4c | 6f 77 65 72 42 6f 75 6e |inomialL|owerBoun|
|000003b0| 64 20 74 6f 20 61 6c 6c | 6f 77 20 73 70 65 63 69 |d to all|ow speci|
|000003c0| 66 69 63 61 74 69 6f 6e | 20 6f 66 20 74 68 65 0d |fication| of the.|
|000003d0| 09 09 64 65 73 69 72 65 | 64 20 63 6f 6e 66 69 64 |..desire|d confid|
|000003e0| 65 6e 63 65 20 6f 66 20 | 74 68 65 20 69 6e 74 65 |ence of |the inte|
|000003f0| 72 76 61 6c 2e 0d 34 2f | 32 34 2f 39 32 09 64 67 |rval..4/|24/92.dg|
|00000400| 70 09 41 64 64 65 64 20 | 42 69 6e 6f 6d 69 61 6c |p.Added |Binomial|
|00000410| 53 61 6d 70 6c 65 51 75 | 69 63 6b 6c 79 28 29 2e |SampleQu|ickly().|
|00000420| 0d 34 2f 32 37 2f 39 32 | 09 64 67 70 09 4f 6f 70 |.4/27/92|.dgp.Oop|
|00000430| 73 2e 20 49 20 6a 75 73 | 74 20 6e 6f 74 69 63 65 |s. I jus|t notice|
|00000440| 64 20 74 68 61 74 20 74 | 68 69 73 20 66 69 6c 65 |d that t|his file|
|00000450| 20 77 61 73 20 61 6c 77 | 61 79 73 20 69 6e 63 6c | was alw|ays incl|
|00000460| 75 64 69 6e 67 20 6e 72 | 2e 68 2c 20 77 68 69 63 |uding nr|.h, whic|
|00000470| 68 20 79 6f 75 27 64 0d | 09 09 09 6f 6e 6c 79 20 |h you'd.|...only |
|00000480| 68 61 76 65 20 69 66 20 | 79 6f 75 20 6f 77 6e 20 |have if |you own |
|00000490| 74 68 65 20 4e 75 6d 65 | 72 69 63 61 6c 20 52 65 |the Nume|rical Re|
|000004a0| 63 69 70 65 73 2e 20 49 | 20 6d 6f 76 65 64 20 74 |cipes. I| moved t|
|000004b0| 68 65 20 69 6e 63 6c 75 | 64 65 20 73 74 61 74 65 |he inclu|de state|
|000004c0| 6d 65 6e 74 0d 09 09 09 | 64 6f 77 6e 20 69 6e 73 |ment....|down ins|
|000004d0| 69 64 65 20 74 68 65 20 | 63 6f 6e 64 69 74 69 6f |ide the |conditio|
|000004e0| 6e 61 6c 20 62 65 6c 6f | 77 2c 20 77 68 65 72 65 |nal belo|w, where|
|000004f0| 20 69 74 20 62 65 6c 6f | 6e 67 73 2e 20 0d 2a 2f | it belo|ngs. .*/|
|00000500| 0d 23 69 6e 63 6c 75 64 | 65 20 22 56 69 64 65 6f |.#includ|e "Video|
|00000510| 54 6f 6f 6c 62 6f 78 2e | 68 22 0d 23 69 6e 63 6c |Toolbox.|h".#incl|
|00000520| 75 64 65 20 3c 6d 61 74 | 68 2e 68 3e 0d 0d 23 64 |ude <mat|h.h>..#d|
|00000530| 65 66 69 6e 65 20 4e 45 | 57 5f 42 49 4e 4f 4d 49 |efine NE|W_BINOMI|
|00000540| 41 4c 20 30 0d 0d 6c 6f | 6e 67 20 42 69 6e 6f 6d |AL 0..lo|ng Binom|
|00000550| 69 61 6c 53 61 6d 70 6c | 65 28 64 6f 75 62 6c 65 |ialSampl|e(double|
|00000560| 20 70 2c 6c 6f 6e 67 20 | 6e 29 0d 2f 2a 0d 52 65 | p,long |n)./*.Re|
|00000570| 74 75 72 6e 73 20 61 20 | 61 20 73 61 6d 70 6c 65 |turns a |a sample|
|00000580| 20 66 72 6f 6d 20 61 20 | 62 69 6e 6f 6d 69 61 6c | from a |binomial|
|00000590| 20 64 69 73 74 72 69 62 | 75 74 69 6f 6e 3a 20 6e | distrib|ution: n|
|000005a0| 75 6d 62 65 72 20 6f 66 | 20 68 65 61 64 73 20 69 |umber of| heads i|
|000005b0| 6e 20 6e 20 66 6c 69 70 | 73 20 6f 66 0d 61 20 77 |n n flip|s of.a w|
|000005c0| 65 69 67 68 74 65 64 20 | 63 6f 69 6e 20 77 69 74 |eighted |coin wit|
|000005d0| 68 20 61 20 70 72 6f 62 | 61 62 69 6c 69 74 79 20 |h a prob|ability |
|000005e0| 70 20 6f 66 20 61 20 68 | 65 61 64 20 6f 6e 20 65 |p of a h|ead on e|
|000005f0| 61 63 68 20 66 6c 69 70 | 2e 20 54 68 69 73 20 69 |ach flip|. This i|
|00000600| 73 20 66 69 6e 65 20 69 | 66 20 6e 20 69 73 20 73 |s fine i|f n is s|
|00000610| 6d 61 6c 6c 2e 20 48 6f | 77 65 76 65 72 2c 0d 69 |mall. Ho|wever,.i|
|00000620| 66 20 6e 20 69 73 20 6c | 61 72 67 65 2c 20 65 2e |f n is l|arge, e.|
|00000630| 67 2e 20 6e 3e 31 30 30 | 2c 20 74 68 65 6e 20 74 |g. n>100|, then t|
|00000640| 68 69 73 20 72 6f 75 74 | 69 6e 65 20 77 69 6c 6c |his rout|ine will|
|00000650| 20 62 65 20 72 61 74 68 | 65 72 20 73 6c 6f 77 2c | be rath|er slow,|
|00000660| 20 61 6e 64 20 79 6f 75 | 20 6d 61 79 20 70 72 65 | and you| may pre|
|00000670| 66 65 72 0d 74 6f 20 75 | 73 65 20 74 68 65 20 6d |fer.to u|se the m|
|00000680| 6f 72 65 20 65 6c 61 62 | 6f 72 61 74 65 20 4e 75 |ore elab|orate Nu|
|00000690| 6d 65 72 69 63 61 6c 20 | 52 65 63 69 70 65 73 20 |merical |Recipes |
|000006a0| 62 6e 6c 64 65 76 28 29 | 20 72 6f 75 74 69 6e 65 |bnldev()| routine|
|000006b0| 2e 0d 2a 2f 0d 7b 0d 09 | 6c 6f 6e 67 20 6b 2c 69 |..*/.{..|long k,i|
|000006c0| 3b 0d 0d 09 6b 3d 30 3b | 0d 09 66 6f 72 28 69 3d |;...k=0;|..for(i=|
|000006d0| 30 3b 69 3c 6e 3b 69 2b | 2b 29 20 69 66 28 70 3e |0;i<n;i+|+) if(p>|
|000006e0| 55 6e 69 66 6f 72 6d 53 | 61 6d 70 6c 65 28 29 29 |UniformS|ample())|
|000006f0| 6b 2b 2b 3b 0d 09 72 65 | 74 75 72 6e 20 6b 3b 0d |k++;..re|turn k;.|
|00000700| 7d 0d 0d 69 6e 74 20 42 | 69 6e 6f 6d 69 61 6c 53 |}..int B|inomialS|
|00000710| 61 6d 70 6c 65 51 75 69 | 63 6b 6c 79 28 69 6e 74 |ampleQui|ckly(int|
|00000720| 20 6e 29 0d 2f 2f 20 44 | 6f 65 73 20 6e 20 66 6c | n).// D|oes n fl|
|00000730| 69 70 73 20 6f 66 20 61 | 6e 20 75 6e 77 65 69 67 |ips of a|n unweig|
|00000740| 68 74 65 64 20 63 6f 69 | 6e 20 61 6e 64 20 72 65 |hted coi|n and re|
|00000750| 74 75 72 6e 73 20 74 68 | 65 20 6e 75 6d 62 65 72 |turns th|e number|
|00000760| 20 6f 66 20 68 65 61 64 | 73 2e 20 56 65 72 79 20 | of head|s. Very |
|00000770| 66 61 73 74 20 69 66 20 | 6e 3c 31 30 30 30 2e 20 |fast if |n<1000. |
|00000780| 0d 2f 2f 20 46 6f 72 20 | 6c 61 72 67 65 72 20 6e |.// For |larger n|
|00000790| 20 69 74 20 77 6f 75 6c | 64 20 62 65 20 66 61 73 | it woul|d be fas|
|000007a0| 74 65 72 20 74 6f 20 75 | 73 65 20 62 6e 6c 64 65 |ter to u|se bnlde|
|000007b0| 76 28 29 2e 0d 7b 0d 09 | 72 65 67 69 73 74 65 72 |v()..{..|register|
|000007c0| 20 69 6e 74 20 69 2c 6b | 3d 30 3b 0d 09 72 65 67 | int i,k|=0;..reg|
|000007d0| 69 73 74 65 72 20 73 68 | 6f 72 74 20 72 3b 0d 09 |ister sh|ort r;..|
|000007e0| 0d 09 66 6f 72 28 69 3d | 6e 3b 69 3e 3d 38 3b 69 |..for(i=|n;i>=8;i|
|000007f0| 2d 3d 38 29 7b 0d 09 09 | 72 3d 72 61 6e 64 55 28 |-=8){...|r=randU(|
|00000800| 29 3b 09 2f 2f 20 55 73 | 65 20 6f 6e 6c 79 20 74 |);.// Us|e only t|
|00000810| 68 65 20 75 70 70 65 72 | 20 38 20 62 69 74 73 2c |he upper| 8 bits,|
|00000820| 20 77 68 69 63 68 20 61 | 72 65 20 72 65 70 75 74 | which a|re reput|
|00000830| 65 64 20 74 6f 20 62 65 | 20 6d 6f 72 65 20 72 61 |ed to be| more ra|
|00000840| 6e 64 6f 6d 2e 0d 09 09 | 69 66 28 72 3c 30 29 6b |ndom....|if(r<0)k|
|00000850| 2b 2b 3b 0d 09 09 72 3c | 3c 3d 31 3b 0d 09 09 69 |++;...r<|<=1;...i|
|00000860| 66 28 72 3c 30 29 6b 2b | 2b 3b 0d 09 09 72 3c 3c |f(r<0)k+|+;...r<<|
|00000870| 3d 31 3b 0d 09 09 69 66 | 28 72 3c 30 29 6b 2b 2b |=1;...if|(r<0)k++|
|00000880| 3b 0d 09 09 72 3c 3c 3d | 31 3b 0d 09 09 69 66 28 |;...r<<=|1;...if(|
|00000890| 72 3c 30 29 6b 2b 2b 3b | 0d 09 09 72 3c 3c 3d 31 |r<0)k++;|...r<<=1|
|000008a0| 3b 0d 09 09 69 66 28 72 | 3c 30 29 6b 2b 2b 3b 0d |;...if(r|<0)k++;.|
|000008b0| 09 09 72 3c 3c 3d 31 3b | 0d 09 09 69 66 28 72 3c |..r<<=1;|...if(r<|
|000008c0| 30 29 6b 2b 2b 3b 0d 09 | 09 72 3c 3c 3d 31 3b 0d |0)k++;..|.r<<=1;.|
|000008d0| 09 09 69 66 28 72 3c 30 | 29 6b 2b 2b 3b 0d 09 09 |..if(r<0|)k++;...|
|000008e0| 72 3c 3c 3d 31 3b 0d 09 | 09 69 66 28 72 3c 30 29 |r<<=1;..|.if(r<0)|
|000008f0| 6b 2b 2b 3b 0d 09 09 72 | 3c 3c 3d 31 3b 0d 09 7d |k++;...r|<<=1;..}|
|00000900| 0d 09 69 66 28 69 3e 30 | 29 7b 0d 09 09 72 3d 72 |..if(i>0|){...r=r|
|00000910| 61 6e 64 55 28 29 3b 0d | 09 09 66 6f 72 28 3b 69 |andU();.|..for(;i|
|00000920| 3e 30 3b 69 2d 2d 29 7b | 0d 09 09 09 69 66 28 72 |>0;i--){|....if(r|
|00000930| 3c 30 29 6b 2b 2b 3b 0d | 09 09 09 72 3c 3c 3d 31 |<0)k++;.|...r<<=1|
|00000940| 3b 0d 09 09 7d 0d 09 7d | 0d 09 72 65 74 75 72 6e |;...}..}|..return|
|00000950| 20 6b 3b 0d 7d 0d 0d 2f | 2a 0d 42 69 6e 6f 6d 69 | k;.}../|*.Binomi|
|00000960| 61 6c 55 70 70 65 72 42 | 6f 75 6e 64 20 61 6e 64 |alUpperB|ound and|
|00000970| 20 42 69 6e 6f 6d 69 61 | 6c 4c 6f 77 65 72 42 6f | Binomia|lLowerBo|
|00000980| 75 6e 64 20 72 65 74 75 | 72 6e 20 61 20 50 20 63 |und retu|rn a P c|
|00000990| 6f 6e 66 69 64 65 6e 63 | 65 20 69 6e 74 65 72 76 |onfidenc|e interv|
|000009a0| 61 6c 20 66 6f 72 20 74 | 68 65 0d 75 6e 64 65 72 |al for t|he.under|
|000009b0| 6c 79 69 6e 67 20 62 69 | 6e 6f 6d 69 61 6c 20 70 |lying bi|nomial p|
|000009c0| 72 6f 62 61 62 69 6c 69 | 74 79 20 61 73 73 75 6d |robabili|ty assum|
|000009d0| 65 64 20 74 6f 20 68 61 | 76 65 20 67 65 6e 65 72 |ed to ha|ve gener|
|000009e0| 61 74 65 64 20 74 68 65 | 20 64 61 74 61 2e 0d 0d |ated the| data...|
|000009f0| 54 68 65 20 66 6f 72 6d | 75 6c 61 20 69 73 20 62 |The form|ula is b|
|00000a00| 61 73 65 64 20 6f 6e 20 | 61 20 47 61 75 73 73 69 |ased on |a Gaussi|
|00000a10| 61 6e 20 61 70 70 72 6f | 78 69 6d 61 74 69 6f 6e |an appro|ximation|
|00000a20| 2c 20 73 6f 6c 76 69 6e | 67 20 66 6f 72 20 74 68 |, solvin|g for th|
|00000a30| 65 20 70 20 74 68 61 74 | 20 77 69 6c 6c 0d 70 75 |e p that| will.pu|
|00000a40| 74 20 74 68 65 20 6f 62 | 73 65 72 76 65 64 20 72 |t the ob|served r|
|00000a50| 65 73 75 6c 74 20 74 68 | 65 20 72 69 67 68 74 20 |esult th|e right |
|00000a60| 6e 75 6d 62 65 72 20 6f | 66 20 73 74 61 6e 64 61 |number o|f standa|
|00000a70| 72 64 20 64 65 76 69 61 | 74 69 6f 6e 73 20 61 77 |rd devia|tions aw|
|00000a80| 61 79 20 66 72 6f 6d 20 | 74 68 65 0d 6d 65 61 6e |ay from |the.mean|
|00000a90| 2c 20 70 6c 75 73 20 6f | 72 20 6d 69 6e 75 73 20 |, plus o|r minus |
|00000aa0| 30 2e 35 2c 20 61 73 20 | 61 20 22 63 6f 6e 74 69 |0.5, as |a "conti|
|00000ab0| 6e 75 69 74 79 20 63 6f | 72 72 65 63 74 69 6f 6e |nuity co|rrection|
|00000ac0| 22 2e 0d 0d 54 68 69 73 | 20 69 73 20 74 68 65 20 |"...This| is the |
|00000ad0| 62 65 73 74 20 66 6f 72 | 6d 75 6c 61 20 49 20 63 |best for|mula I c|
|00000ae0| 6f 75 6c 64 20 66 69 6e | 64 20 69 6e 20 6c 6f 6f |ould fin|d in loo|
|00000af0| 6b 69 6e 67 20 74 68 72 | 6f 75 67 68 20 73 65 76 |king thr|ough sev|
|00000b00| 65 72 61 6c 20 73 74 61 | 74 69 73 74 69 63 73 0d |eral sta|tistics.|
|00000b10| 62 6f 6f 6b 73 2e 20 48 | 6f 77 65 76 65 72 2c 20 |books. H|owever, |
|00000b20| 74 68 65 20 72 65 73 75 | 6c 74 20 68 61 73 20 74 |the resu|lt has t|
|00000b30| 6f 20 62 65 20 74 61 6b | 65 6e 20 77 69 74 68 20 |o be tak|en with |
|00000b40| 61 20 67 72 61 69 6e 20 | 6f 66 20 73 61 6c 74 20 |a grain |of salt |
|00000b50| 62 65 63 61 75 73 65 20 | 69 74 20 69 73 0d 6e 6f |because |it is.no|
|00000b60| 74 20 70 6f 73 73 69 62 | 6c 65 20 74 6f 20 70 72 |t possib|le to pr|
|00000b70| 6f 64 75 63 65 20 61 20 | 62 69 6e 6f 6d 69 61 6c |oduce a |binomial|
|00000b80| 20 63 6f 6e 66 69 64 65 | 6e 63 65 20 69 6e 74 65 | confide|nce inte|
|00000b90| 72 76 61 6c 20 74 68 61 | 74 20 77 69 6c 6c 20 73 |rval tha|t will s|
|00000ba0| 61 74 69 73 66 79 20 74 | 68 65 0d 73 74 72 69 63 |atisfy t|he.stric|
|00000bb0| 74 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 6f 66 20 |t defini|tion of |
|00000bc0| 61 20 63 6f 6e 66 69 64 | 65 6e 63 65 20 69 6e 74 |a confid|ence int|
|00000bd0| 65 72 76 61 6c 2c 20 6e | 61 6d 65 6c 79 20 6f 6e |erval, n|amely on|
|00000be0| 65 20 74 68 61 74 20 77 | 69 6c 6c 20 68 61 76 65 |e that w|ill have|
|00000bf0| 20 74 68 65 0d 73 70 65 | 63 69 66 69 65 64 20 70 | the.spe|cified p|
|00000c00| 72 6f 62 61 62 69 6c 69 | 74 79 20 50 20 6f 66 20 |robabili|ty P of |
|00000c10| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 74 68 65 20 75 |containi|ng the u|
|00000c20| 6e 6b 6e 6f 77 6e 20 62 | 75 74 20 66 69 78 65 64 |nknown b|ut fixed|
|00000c30| 20 70 61 72 61 6d 65 74 | 65 72 20 70 2e 20 54 68 | paramet|er p. Th|
|00000c40| 61 74 27 73 0d 62 65 63 | 61 75 73 65 2c 20 75 6e |at's.bec|ause, un|
|00000c50| 6c 69 6b 65 20 74 68 65 | 20 4e 6f 72 6d 61 6c 20 |like the| Normal |
|00000c60| 64 69 73 74 72 69 62 75 | 74 69 6f 6e 2c 20 74 68 |distribu|tion, th|
|00000c70| 65 20 42 69 6e 6f 6d 69 | 61 6c 20 64 69 73 74 72 |e Binomi|al distr|
|00000c80| 69 62 75 74 69 6f 6e 20 | 69 73 20 6e 6f 74 0d 74 |ibution |is not.t|
|00000c90| 72 61 6e 73 6c 61 74 69 | 6f 6e 20 69 6e 76 61 72 |ranslati|on invar|
|00000ca0| 69 61 6e 74 2e 20 0d 0d | 49 20 67 61 76 65 20 73 |iant. ..|I gave s|
|00000cb0| 6f 6d 65 20 74 68 6f 75 | 67 68 74 20 74 6f 20 74 |ome thou|ght to t|
|00000cc0| 61 6b 69 6e 67 20 61 20 | 42 61 79 65 73 69 61 6e |aking a |Bayesian|
|00000cd0| 20 61 70 70 72 6f 61 63 | 68 2c 20 61 73 73 75 6d | approac|h, assum|
|00000ce0| 69 6e 67 20 61 20 75 6e | 69 66 6f 72 6d 20 70 72 |ing a un|iform pr|
|00000cf0| 69 6f 72 20 70 64 66 0d | 66 6f 72 20 70 20 61 6e |ior pdf.|for p an|
|00000d00| 64 20 74 68 65 6e 20 63 | 6f 6d 70 75 74 69 6e 67 |d then c|omputing|
|00000d10| 20 61 6e 20 61 20 70 6f | 73 74 65 72 69 6f 72 69 | an a po|steriori|
|00000d20| 20 63 6f 6e 66 69 64 65 | 6e 63 65 20 69 6e 74 65 | confide|nce inte|
|00000d30| 72 76 61 6c 2e 20 54 68 | 69 73 20 63 61 6e 20 62 |rval. Th|is can b|
|00000d40| 65 20 64 6f 6e 65 2c 0d | 62 75 74 20 69 74 27 73 |e done,.|but it's|
|00000d50| 20 68 61 72 64 2e 20 49 | 20 63 6f 6e 63 6c 75 64 | hard. I| conclud|
|00000d60| 65 64 20 74 68 61 74 20 | 69 74 27 73 20 70 6f 69 |ed that |it's poi|
|00000d70| 6e 74 6c 65 73 73 20 62 | 65 63 61 75 73 65 20 74 |ntless b|ecause t|
|00000d80| 68 65 20 75 6e 69 66 6f | 72 6d 20 70 72 69 6f 72 |he unifo|rm prior|
|00000d90| 20 70 64 66 0d 61 73 73 | 75 6d 70 74 69 6f 6e 20 | pdf.ass|umption |
|00000da0| 69 73 20 75 73 75 61 6c | 6c 79 20 75 6e 77 61 72 |is usual|ly unwar|
|00000db0| 72 61 6e 74 65 64 2e 0d | 0d 45 76 65 6e 20 74 68 |ranted..|.Even th|
|00000dc0| 6f 75 67 68 20 74 68 69 | 73 20 63 6f 6e 66 69 64 |ough thi|s confid|
|00000dd0| 65 6e 63 65 20 69 6e 74 | 65 72 76 61 6c 20 69 73 |ence int|erval is|
|00000de0| 20 6e 6f 74 20 77 68 6f | 6c 6c 79 20 73 61 74 69 | not who|lly sati|
|00000df0| 73 66 61 63 74 6f 72 79 | 20 28 69 2e 65 2e 20 66 |sfactory| (i.e. f|
|00000e00| 75 6e 64 61 6d 65 6e 74 | 61 6c 6c 79 0d 66 61 6c |undament|ally.fal|
|00000e10| 73 65 29 20 69 74 20 69 | 73 20 75 73 65 66 75 6c |se) it i|s useful|
|00000e20| 20 69 6e 20 70 72 61 63 | 74 69 63 65 20 73 69 6e | in prac|tice sin|
|00000e30| 63 65 20 69 74 20 74 79 | 70 69 63 61 6c 6c 79 20 |ce it ty|pically |
|00000e40| 62 65 68 61 76 65 73 20 | 73 69 6d 69 6c 61 72 6c |behaves |similarl|
|00000e50| 79 20 74 6f 20 74 68 65 | 0d 4e 6f 72 6d 61 6c 20 |y to the|.Normal |
|00000e60| 63 61 73 65 2c 20 77 68 | 69 63 68 20 69 73 20 74 |case, wh|ich is t|
|00000e70| 68 65 6f 72 65 74 69 63 | 61 6c 6c 79 20 73 6f 75 |heoretic|ally sou|
|00000e80| 6e 64 2e 0d 2a 2f 0d 64 | 6f 75 62 6c 65 20 42 69 |nd..*/.d|ouble Bi|
|00000e90| 6e 6f 6d 69 61 6c 4c 6f | 77 65 72 42 6f 75 6e 64 |nomialLo|werBound|
|00000ea0| 28 64 6f 75 62 6c 65 20 | 50 2c 6c 6f 6e 67 20 6b |(double |P,long k|
|00000eb0| 2c 6c 6f 6e 67 20 6e 29 | 0d 2f 2a 0d 41 72 67 75 |,long n)|./*.Argu|
|00000ec0| 6d 65 6e 74 73 20 61 72 | 65 20 74 68 65 20 63 6f |ments ar|e the co|
|00000ed0| 6e 66 69 64 65 6e 63 65 | 20 50 2c 20 61 6e 64 20 |nfidence| P, and |
|00000ee0| 74 68 65 20 6e 75 6d 62 | 65 72 20 6b 20 6f 66 20 |the numb|er k of |
|00000ef0| 68 65 61 64 73 20 69 6e | 20 6e 20 66 6c 69 70 73 |heads in| n flips|
|00000f00| 20 6f 66 20 61 20 63 6f | 69 6e 2e 0d 54 68 65 20 | of a co|in..The |
|00000f10| 72 65 74 75 72 6e 65 64 | 20 76 61 6c 75 65 20 70 |returned| value p|
|00000f20| 20 69 73 20 74 68 65 20 | 6c 6f 77 65 72 20 65 6e | is the |lower en|
|00000f30| 64 20 6f 66 20 61 20 32 | 3f 2d 73 69 64 65 64 20 |d of a 2|?-sided |
|00000f40| 50 20 63 6f 6e 66 69 64 | 65 6e 63 65 20 69 6e 74 |P confid|ence int|
|00000f50| 65 72 76 61 6c 20 6f 6e | 20 74 68 65 0d 75 6e 64 |erval on| the.und|
|00000f60| 65 72 6c 79 69 6e 67 20 | 70 72 6f 62 61 62 69 6c |erlying |probabil|
|00000f70| 69 74 79 20 6f 66 20 61 | 20 68 65 61 64 20 6f 6e |ity of a| head on|
|00000f80| 20 61 20 73 69 6e 67 6c | 65 20 74 72 69 61 6c 2e | a singl|e trial.|
|00000f90| 0d 2a 2f 0d 7b 0d 09 64 | 6f 75 62 6c 65 20 72 69 |.*/.{..d|ouble ri|
|00000fa0| 67 68 74 2c 73 2c 73 73 | 2c 70 3b 0d 09 0d 09 69 |ght,s,ss|,p;....i|
|00000fb0| 66 28 6b 3e 30 20 26 26 | 20 6b 3c 6e 29 7b 0d 09 |f(k>0 &&| k<n){..|
|00000fc0| 09 72 69 67 68 74 3d 6b | 2d 30 2e 35 3b 0d 09 09 |.right=k|-0.5;...|
|00000fd0| 73 3d 49 6e 76 65 72 73 | 65 4e 6f 72 6d 61 6c 28 |s=Invers|eNormal(|
|00000fe0| 73 71 72 74 28 50 29 29 | 3b 0d 09 09 73 73 3d 73 |sqrt(P))|;...ss=s|
|00000ff0| 2a 73 3b 0d 09 09 70 3d | 28 72 69 67 68 74 2b 30 |*s;...p=|(right+0|
|00001000| 2e 35 2a 73 73 2d 73 2a | 73 71 72 74 28 72 69 67 |.5*ss-s*|sqrt(rig|
|00001010| 68 74 2a 28 31 2e 30 2d | 72 69 67 68 74 2f 6e 29 |ht*(1.0-|right/n)|
|00001020| 2b 30 2e 32 35 2a 73 73 | 29 29 2f 28 6e 2b 73 73 |+0.25*ss|))/(n+ss|
|00001030| 29 3b 0d 09 09 72 65 74 | 75 72 6e 20 70 3b 0d 09 |);...ret|urn p;..|
|00001040| 7d 0d 09 69 66 28 6b 3d | 3d 30 29 20 72 65 74 75 |}..if(k=|=0) retu|
|00001050| 72 6e 20 30 2e 30 3b 0d | 09 69 66 28 6b 3d 3d 6e |rn 0.0;.|.if(k==n|
|00001060| 29 20 72 65 74 75 72 6e | 20 70 6f 77 28 31 2e 30 |) return| pow(1.0|
|00001070| 2d 50 2c 31 2e 30 2f 6e | 29 3b 0d 09 72 65 74 75 |-P,1.0/n|);..retu|
|00001080| 72 6e 20 73 71 72 74 28 | 2d 31 2e 30 29 3b 09 2f |rn sqrt(|-1.0);./|
|00001090| 2a 20 64 6f 6d 61 69 6e | 20 65 72 72 6f 72 20 2a |* domain| error *|
|000010a0| 2f 0d 7d 0d 0d 64 6f 75 | 62 6c 65 20 42 69 6e 6f |/.}..dou|ble Bino|
|000010b0| 6d 69 61 6c 55 70 70 65 | 72 42 6f 75 6e 64 28 64 |mialUppe|rBound(d|
|000010c0| 6f 75 62 6c 65 20 50 2c | 6c 6f 6e 67 20 6b 2c 6c |ouble P,|long k,l|
|000010d0| 6f 6e 67 20 6e 29 0d 2f | 2a 0d 41 72 67 75 6d 65 |ong n)./|*.Argume|
|000010e0| 6e 74 73 20 61 72 65 20 | 74 68 65 20 63 6f 6e 66 |nts are |the conf|
|000010f0| 69 64 65 6e 63 65 20 50 | 2c 20 61 6e 64 20 74 68 |idence P|, and th|
|00001100| 65 20 6e 75 6d 62 65 72 | 20 6b 20 6f 66 20 68 65 |e number| k of he|
|00001110| 61 64 73 20 69 6e 20 6e | 20 66 6c 69 70 73 20 6f |ads in n| flips o|
|00001120| 66 20 61 20 63 6f 69 6e | 2e 0d 54 68 65 20 72 65 |f a coin|..The re|
|00001130| 74 75 72 6e 65 64 20 76 | 61 6c 75 65 20 70 20 69 |turned v|alue p i|
|00001140| 73 20 74 68 65 20 75 70 | 70 65 72 20 65 6e 64 20 |s the up|per end |
|00001150| 6f 66 20 61 20 32 3f 2d | 73 69 64 65 64 20 50 20 |of a 2?-|sided P |
|00001160| 63 6f 6e 66 69 64 65 6e | 63 65 20 69 6e 74 65 72 |confiden|ce inter|
|00001170| 76 61 6c 20 6f 6e 20 74 | 68 65 0d 75 6e 64 65 72 |val on t|he.under|
|00001180| 6c 79 69 6e 67 20 70 72 | 6f 62 61 62 69 6c 69 74 |lying pr|obabilit|
|00001190| 79 20 6f 66 20 61 20 68 | 65 61 64 20 6f 6e 20 61 |y of a h|ead on a|
|000011a0| 20 73 69 6e 67 6c 65 20 | 74 72 69 61 6c 2e 0d 2a | single |trial..*|
|000011b0| 2f 0d 7b 0d 09 64 6f 75 | 62 6c 65 20 72 69 67 68 |/.{..dou|ble righ|
|000011c0| 74 2c 73 2c 73 73 2c 70 | 3b 0d 09 0d 09 69 66 28 |t,s,ss,p|;....if(|
|000011d0| 6b 3e 30 20 26 26 20 6b | 3c 6e 29 7b 0d 09 09 72 |k>0 && k|<n){...r|
|000011e0| 69 67 68 74 3d 6b 2b 30 | 2e 35 3b 0d 09 09 73 3d |ight=k+0|.5;...s=|
|000011f0| 49 6e 76 65 72 73 65 4e | 6f 72 6d 61 6c 28 73 71 |InverseN|ormal(sq|
|00001200| 72 74 28 50 29 29 3b 0d | 09 09 73 73 3d 73 2a 73 |rt(P));.|..ss=s*s|
|00001210| 3b 0d 09 09 70 3d 28 72 | 69 67 68 74 2b 30 2e 35 |;...p=(r|ight+0.5|
|00001220| 2a 73 73 2b 73 2a 73 71 | 72 74 28 72 69 67 68 74 |*ss+s*sq|rt(right|
|00001230| 2a 28 31 2e 30 2d 72 69 | 67 68 74 2f 6e 29 2b 30 |*(1.0-ri|ght/n)+0|
|00001240| 2e 32 35 2a 73 73 29 29 | 2f 28 6e 2b 73 73 29 3b |.25*ss))|/(n+ss);|
|00001250| 0d 09 09 72 65 74 75 72 | 6e 20 70 3b 0d 09 7d 0d |...retur|n p;..}.|
|00001260| 09 69 66 28 6b 3d 3d 30 | 29 20 72 65 74 75 72 6e |.if(k==0|) return|
|00001270| 20 31 2e 30 2d 70 6f 77 | 28 31 2e 30 2d 50 2c 31 | 1.0-pow|(1.0-P,1|
|00001280| 2e 30 2f 6e 29 3b 0d 09 | 69 66 28 6b 3d 3d 6e 29 |.0/n);..|if(k==n)|
|00001290| 20 72 65 74 75 72 6e 20 | 31 2e 30 3b 0d 09 72 65 | return |1.0;..re|
|000012a0| 74 75 72 6e 20 73 71 72 | 74 28 2d 31 2e 30 29 3b |turn sqr|t(-1.0);|
|000012b0| 09 2f 2a 20 64 6f 6d 61 | 69 6e 20 65 72 72 6f 72 |./* doma|in error|
|000012c0| 20 2a 2f 0d 7d 0d 0d 23 | 69 66 20 4e 45 57 5f 42 | */.}..#|if NEW_B|
|000012d0| 49 4e 4f 4d 49 41 4c 09 | 2f 2a 20 6e 65 77 20 72 |INOMIAL.|/* new r|
|000012e0| 6f 75 74 69 6e 65 73 20 | 74 68 61 74 20 72 65 71 |outines |that req|
|000012f0| 75 69 72 65 20 4e 75 6d | 65 72 69 63 61 6c 20 52 |uire Num|erical R|
|00001300| 65 63 69 70 65 73 20 69 | 6e 20 43 20 2a 2f 0d 09 |ecipes i|n C */..|
|00001310| 23 69 6e 63 6c 75 64 65 | 20 22 6e 72 2e 68 22 09 |#include| "nr.h".|
|00001320| 09 09 09 2f 2a 20 70 72 | 6f 74 6f 74 79 70 65 20 |.../* pr|ototype |
|00001330| 66 6f 72 20 62 65 74 61 | 69 28 29 20 2a 2f 0d 09 |for beta|i() */..|
|00001340| 23 69 66 20 30 0d 09 09 | 76 6f 69 64 20 6d 61 69 |#if 0...|void mai|
|00001350| 6e 28 76 6f 69 64 29 0d | 09 09 2f 2a 20 61 20 71 |n(void).|../* a q|
|00001360| 75 69 63 6b 20 61 6e 64 | 20 64 69 72 74 79 20 64 |uick and| dirty d|
|00001370| 72 69 76 65 72 20 74 6f | 20 74 65 73 74 20 73 6f |river to| test so|
|00001380| 6d 65 20 6f 66 20 74 68 | 65 73 65 20 72 6f 75 74 |me of th|ese rout|
|00001390| 69 6e 65 73 20 2a 2f 0d | 09 09 7b 0d 09 09 09 64 |ines */.|..{....d|
|000013a0| 6f 75 62 6c 65 20 70 2c | 70 55 70 70 65 72 2c 70 |ouble p,|pUpper,p|
|000013b0| 4c 6f 77 65 72 2c 50 2c | 50 55 70 70 65 72 2c 50 |Lower,P,|PUpper,P|
|000013c0| 4c 6f 77 65 72 3b 0d 09 | 09 09 69 6e 74 20 69 2c |Lower;..|..int i,|
|000013d0| 6e 2c 6b 3b 0d 09 09 09 | 0d 09 09 09 52 65 71 75 |n,k;....|....Requ|
|000013e0| 69 72 65 28 30 29 3b 0d | 09 09 09 6e 3d 31 30 3b |ire(0);.|...n=10;|
|000013f0| 0d 09 09 09 70 3d 2e 32 | 3b 0d 09 09 09 70 4c 6f |....p=.2|;....pLo|
|00001400| 77 65 72 3d 49 6e 76 65 | 72 73 65 42 69 6e 6f 6d |wer=Inve|rseBinom|
|00001410| 69 61 6c 28 30 2e 30 35 | 2c 32 31 2c 35 30 29 3b |ial(0.05|,21,50);|
|00001420| 0d 09 09 09 70 72 69 6e | 74 66 28 22 25 66 2c 20 |....prin|tf("%f, |
|00001430| 41 62 72 61 6d 6f 77 69 | 74 7a 20 26 20 53 74 65 |Abramowi|tz & Ste|
|00001440| 67 75 6e 20 70 2e 20 39 | 36 30 20 45 78 61 6d 70 |gun p. 9|60 Examp|
|00001450| 6c 65 20 31 38 20 73 61 | 79 20 74 68 69 73 20 73 |le 18 sa|y this s|
|00001460| 68 6f 75 6c 64 20 62 65 | 20 30 2e 33 30 30 33 2e |hould be| 0.3003.|
|00001470| 5c 6e 22 2c 70 4c 6f 77 | 65 72 29 3b 0d 09 09 09 |\n",pLow|er);....|
|00001480| 50 3d 30 2e 39 35 3b 0d | 09 09 09 66 6f 72 28 69 |P=0.95;.|...for(i|
|00001490| 3d 30 3b 69 3c 31 30 3b | 69 2b 2b 29 7b 0d 09 09 |=0;i<10;|i++){...|
|000014a0| 09 09 6b 3d 42 69 6e 6f | 6d 69 61 6c 53 61 6d 70 |..k=Bino|mialSamp|
|000014b0| 6c 65 28 20 70 2c 20 6e | 29 3b 0d 09 09 09 09 70 |le( p, n|);.....p|
|000014c0| 4c 6f 77 65 72 3d 42 69 | 6e 6f 6d 69 61 6c 4c 6f |Lower=Bi|nomialLo|
|000014d0| 77 65 72 42 6f 75 6e 64 | 28 50 2c 6b 2c 6e 29 3b |werBound|(P,k,n);|
|000014e0| 0d 09 09 09 09 70 55 70 | 70 65 72 3d 42 69 6e 6f |.....pUp|per=Bino|
|000014f0| 6d 69 61 6c 55 70 70 65 | 72 42 6f 75 6e 64 28 50 |mialUppe|rBound(P|
|00001500| 2c 6b 2c 6e 29 3b 0d 09 | 09 09 09 50 4c 6f 77 65 |,k,n);..|...PLowe|
|00001510| 72 3d 31 2e 30 2d 42 69 | 6e 6f 6d 69 61 6c 28 70 |r=1.0-Bi|nomial(p|
|00001520| 4c 6f 77 65 72 2c 6b 2c | 6e 29 3b 0d 09 09 09 09 |Lower,k,|n);.....|
|00001530| 50 55 70 70 65 72 3d 42 | 69 6e 6f 6d 69 61 6c 28 |PUpper=B|inomial(|
|00001540| 70 55 70 70 65 72 2c 6b | 2b 31 2c 6e 29 3b 0d 09 |pUpper,k|+1,n);..|
|00001550| 09 09 09 70 72 69 6e 74 | 66 28 22 6e 20 25 34 64 |...print|f("n %4d|
|00001560| 20 70 20 25 36 2e 34 66 | 20 25 36 2e 34 66 b2 25 | p %6.4f| %6.4f.%|
|00001570| 36 2e 34 66 b2 25 36 2e | 34 66 20 20 25 36 2e 34 |6.4f.%6.|4f %6.4|
|00001580| 66 3c 20 3c 25 36 2e 34 | 66 5c 6e 22 0d 09 09 09 |f< <%6.4|f\n"....|
|00001590| 09 09 2c 6e 2c 70 2c 70 | 4c 6f 77 65 72 2c 6b 2f |..,n,p,p|Lower,k/|
|000015a0| 28 64 6f 75 62 6c 65 29 | 6e 2c 70 55 70 70 65 72 |(double)|n,pUpper|
|000015b0| 2c 50 4c 6f 77 65 72 2c | 50 55 70 70 65 72 29 3b |,PLower,|PUpper);|
|000015c0| 0d 09 09 09 09 70 4c 6f | 77 65 72 3d 49 6e 76 65 |.....pLo|wer=Inve|
|000015d0| 72 73 65 42 69 6e 6f 6d | 69 61 6c 28 31 2e 30 2d |rseBinom|ial(1.0-|
|000015e0| 73 71 72 74 28 50 29 2c | 6b 2c 6e 29 3b 0d 09 09 |sqrt(P),|k,n);...|
|000015f0| 09 09 70 55 70 70 65 72 | 3d 49 6e 76 65 72 73 65 |..pUpper|=Inverse|
|00001600| 42 69 6e 6f 6d 69 61 6c | 28 73 71 72 74 28 50 29 |Binomial|(sqrt(P)|
|00001610| 2c 6b 2b 31 2c 6e 29 3b | 0d 09 09 09 09 50 4c 6f |,k+1,n);|.....PLo|
|00001620| 77 65 72 3d 31 2e 30 2d | 42 69 6e 6f 6d 69 61 6c |wer=1.0-|Binomial|
|00001630| 28 70 4c 6f 77 65 72 2c | 6b 2c 6e 29 3b 0d 09 09 |(pLower,|k,n);...|
|00001640| 09 09 50 55 70 70 65 72 | 3d 42 69 6e 6f 6d 69 61 |..PUpper|=Binomia|
|00001650| 6c 28 70 55 70 70 65 72 | 2c 6b 2b 31 2c 6e 29 3b |l(pUpper|,k+1,n);|
|00001660| 0d 09 09 09 09 70 72 69 | 6e 74 66 28 22 20 20 25 |.....pri|ntf(" %|
|00001670| 34 64 20 70 20 25 36 2e | 34 66 20 25 36 2e 34 66 |4d p %6.|4f %6.4f|
|00001680| b2 25 36 2e 34 66 b2 25 | 36 2e 34 66 20 20 25 36 |.%6.4f.%|6.4f %6|
|00001690| 2e 34 66 3c 20 3c 25 36 | 2e 34 66 5c 6e 22 0d 09 |.4f< <%6|.4f\n"..|
|000016a0| 09 09 09 09 2c 6e 2c 70 | 2c 70 4c 6f 77 65 72 2c |....,n,p|,pLower,|
|000016b0| 6b 2f 28 64 6f 75 62 6c | 65 29 6e 2c 70 55 70 70 |k/(doubl|e)n,pUpp|
|000016c0| 65 72 2c 50 4c 6f 77 65 | 72 2c 50 55 70 70 65 72 |er,PLowe|r,PUpper|
|000016d0| 29 3b 0d 09 09 09 7d 0d | 09 09 7d 0d 09 23 65 6e |);....}.|..}..#en|
|000016e0| 64 69 66 0d 09 0d 09 64 | 6f 75 62 6c 65 20 42 69 |dif....d|ouble Bi|
|000016f0| 6e 6f 6d 69 61 6c 28 64 | 6f 75 62 6c 65 20 70 2c |nomial(d|ouble p,|
|00001700| 6c 6f 6e 67 20 6b 2c 6c | 6f 6e 67 20 6e 29 0d 09 |long k,l|ong n)..|
|00001710| 2f 2a 0d 09 52 65 74 75 | 72 6e 73 20 74 68 65 20 |/*..Retu|rns the |
|00001720| 70 72 6f 62 61 62 69 6c | 69 74 79 20 6f 66 20 6b |probabil|ity of k|
|00001730| 20 6f 72 20 6d 6f 72 65 | 20 68 65 61 64 73 20 69 | or more| heads i|
|00001740| 6e 20 6e 20 66 6c 69 70 | 73 2c 20 77 68 65 72 65 |n n flip|s, where|
|00001750| 20 70 72 6f 62 61 62 69 | 6c 69 74 79 20 6f 66 0d | probabi|lity of.|
|00001760| 09 65 61 63 68 20 68 65 | 61 64 20 69 73 20 70 2e |.each he|ad is p.|
|00001770| 20 54 68 69 73 20 69 64 | 65 6e 74 69 74 79 20 61 | This id|entity a|
|00001780| 70 70 65 61 72 73 20 69 | 6e 20 4e 75 6d 65 72 69 |ppears i|n Numeri|
|00001790| 63 61 6c 20 52 65 63 69 | 70 65 73 20 69 6e 20 43 |cal Reci|pes in C|
|000017a0| 2c 20 70 61 67 65 20 31 | 38 32 2c 20 61 6e 64 0d |, page 1|82, and.|
|000017b0| 09 69 6e 20 41 62 72 61 | 6d 6f 77 69 74 7a 20 61 |.in Abra|mowitz a|
|000017c0| 6e 64 20 53 74 65 67 75 | 6e 2c 20 70 2e 20 39 34 |nd Stegu|n, p. 94|
|000017d0| 35 2e 20 45 71 2e 32 36 | 2e 35 2e 32 34 2e 0d 09 |5. Eq.26|.5.24...|
|000017e0| 2a 2f 0d 09 7b 0d 09 09 | 69 66 28 6b 3e 6e 29 72 |*/..{...|if(k>n)r|
|000017f0| 65 74 75 72 6e 20 30 2e | 30 3b 0d 09 09 69 66 28 |eturn 0.|0;...if(|
|00001800| 6b 3c 3d 30 4c 29 72 65 | 74 75 72 6e 20 31 2e 30 |k<=0L)re|turn 1.0|
|00001810| 3b 0d 09 09 69 66 28 70 | 3d 3d 30 2e 30 29 7b 0d |;...if(p|==0.0){.|
|00001820| 09 09 09 69 66 28 6b 3d | 3d 30 29 72 65 74 75 72 |...if(k=|=0)retur|
|00001830| 6e 20 31 2e 30 3b 0d 09 | 09 09 65 6c 73 65 20 72 |n 1.0;..|..else r|
|00001840| 65 74 75 72 6e 20 30 2e | 30 3b 0d 09 09 7d 0d 09 |eturn 0.|0;...}..|
|00001850| 09 69 66 28 70 3d 3d 31 | 2e 30 29 72 65 74 75 72 |.if(p==1|.0)retur|
|00001860| 6e 20 31 2e 30 3b 0d 09 | 09 72 65 74 75 72 6e 20 |n 1.0;..|.return |
|00001870| 49 6e 63 6f 6d 70 6c 65 | 74 65 42 65 74 61 28 70 |Incomple|teBeta(p|
|00001880| 2c 6b 2c 6e 2d 6b 2b 31 | 29 3b 0d 09 7d 0d 09 0d |,k,n-k+1|);..}...|
|00001890| 09 64 6f 75 62 6c 65 20 | 42 69 6e 6f 6d 69 61 6c |.double |Binomial|
|000018a0| 50 64 66 28 64 6f 75 62 | 6c 65 20 70 2c 6c 6f 6e |Pdf(doub|le p,lon|
|000018b0| 67 20 6b 2c 6c 6f 6e 67 | 20 6e 29 0d 09 2f 2a 0d |g k,long| n)../*.|
|000018c0| 09 52 65 74 75 72 6e 73 | 20 74 68 65 20 70 72 6f |.Returns| the pro|
|000018d0| 62 61 62 69 6c 69 74 79 | 20 6f 66 20 65 78 61 63 |bability| of exac|
|000018e0| 74 6c 79 20 6b 20 68 65 | 61 64 73 20 69 6e 20 6e |tly k he|ads in n|
|000018f0| 20 66 6c 69 70 73 2c 20 | 77 68 65 72 65 20 70 72 | flips, |where pr|
|00001900| 6f 62 61 62 69 6c 69 74 | 79 20 6f 66 0d 09 65 61 |obabilit|y of..ea|
|00001910| 63 68 20 68 65 61 64 20 | 69 73 20 70 2e 20 0d 09 |ch head |is p. ..|
|00001920| 49 27 6d 20 6e 6f 74 20 | 72 65 61 6c 6c 79 20 73 |I'm not |really s|
|00001930| 75 72 65 20 77 68 65 74 | 68 65 72 20 74 68 69 73 |ure whet|her this|
|00001940| 20 69 73 20 6d 6f 72 65 | 20 63 6f 6d 70 75 74 61 | is more| computa|
|00001950| 74 69 6f 6e 61 6c 6c 79 | 20 65 66 66 69 63 69 65 |tionally| efficie|
|00001960| 6e 74 20 74 68 61 6e 20 | 63 6f 6d 70 75 74 69 6e |nt than |computin|
|00001970| 67 0d 09 69 74 20 64 69 | 72 65 63 74 6c 79 2c 20 |g..it di|rectly, |
|00001980| 66 72 6f 6d 20 74 68 65 | 20 64 65 66 69 6e 69 74 |from the| definit|
|00001990| 69 6f 6e 20 6f 66 20 74 | 68 65 20 62 69 6e 6f 6d |ion of t|he binom|
|000019a0| 69 61 6c 20 64 69 73 74 | 72 69 62 75 74 69 6f 6e |ial dist|ribution|
|000019b0| 2c 20 62 75 74 20 69 74 | 20 69 73 20 76 65 72 79 |, but it| is very|
|000019c0| 20 65 61 73 79 0d 09 74 | 6f 20 77 72 69 74 65 2c | easy..t|o write,|
|000019d0| 20 61 6e 64 20 61 76 6f | 69 64 73 20 74 68 65 20 | and avo|ids the |
|000019e0| 64 69 66 66 69 63 75 6c | 74 79 20 6f 66 20 63 6f |difficul|ty of co|
|000019f0| 6d 70 75 74 69 6e 67 20 | 74 68 65 20 62 69 6e 6f |mputing |the bino|
|00001a00| 6d 69 61 6c 20 63 6f 65 | 66 66 69 63 69 65 6e 74 |mial coe|fficient|
|00001a10| 0d 09 77 69 74 68 6f 75 | 74 20 6f 76 65 72 66 6c |..withou|t overfl|
|00001a20| 6f 77 2e 0d 09 2a 2f 0d | 09 7b 0d 09 09 69 66 28 |ow...*/.|.{...if(|
|00001a30| 6b 3c 30 4c 20 7c 7c 20 | 6b 3e 6e 29 72 65 74 75 |k<0L || |k>n)retu|
|00001a40| 72 6e 20 30 2e 30 3b 0d | 09 09 69 66 28 6b 3d 3d |rn 0.0;.|..if(k==|
|00001a50| 6e 29 20 72 65 74 75 72 | 6e 20 70 6f 77 28 70 2c |n) retur|n pow(p,|
|00001a60| 6e 29 3b 0d 09 09 72 65 | 74 75 72 6e 20 42 69 6e |n);...re|turn Bin|
|00001a70| 6f 6d 69 61 6c 28 70 2c | 6b 2c 6e 29 2d 42 69 6e |omial(p,|k,n)-Bin|
|00001a80| 6f 6d 69 61 6c 28 70 2c | 6b 2b 31 2c 6e 29 3b 0d |omial(p,|k+1,n);.|
|00001a90| 09 7d 0d 09 0d 09 64 6f | 75 62 6c 65 20 49 6e 76 |.}....do|uble Inv|
|00001aa0| 65 72 73 65 42 69 6e 6f | 6d 69 61 6c 28 64 6f 75 |erseBino|mial(dou|
|00001ab0| 62 6c 65 20 50 2c 6c 6f | 6e 67 20 6b 2c 6c 6f 6e |ble P,lo|ng k,lon|
|00001ac0| 67 20 6e 29 0d 09 2f 2a | 20 52 65 74 75 72 6e 73 |g n)../*| Returns|
|00001ad0| 20 74 68 65 20 50 2d 74 | 68 20 71 75 61 6e 74 69 | the P-t|h quanti|
|00001ae0| 6c 65 20 66 6f 72 20 74 | 68 65 20 70 72 6f 62 61 |le for t|he proba|
|00001af0| 62 69 6c 69 74 79 20 70 | 20 6f 66 20 61 20 68 65 |bility p| of a he|
|00001b00| 61 64 73 2c 0d 09 67 69 | 76 65 6e 20 6b 20 68 65 |ads,..gi|ven k he|
|00001b10| 61 64 73 20 69 6e 20 6e | 20 66 6c 69 70 73 2e 20 |ads in n| flips. |
|00001b20| 0d 09 70 55 70 70 65 72 | 3d 49 6e 76 65 72 73 65 |..pUpper|=Inverse|
|00001b30| 42 69 6e 6f 6d 69 61 6c | 28 30 2e 39 37 35 2c 6b |Binomial|(0.975,k|
|00001b40| 2b 31 2c 6e 29 20 69 73 | 20 61 20 39 37 2e 35 25 |+1,n) is| a 97.5%|
|00001b50| 20 63 6f 6e 66 69 64 65 | 6e 63 65 20 75 70 70 65 | confide|nce uppe|
|00001b60| 72 20 62 6f 75 6e 64 20 | 6f 6e 20 70 0d 09 70 4c |r bound |on p..pL|
|00001b70| 6f 77 65 72 3d 49 6e 76 | 65 72 73 65 42 69 6e 6f |ower=Inv|erseBino|
|00001b80| 6d 69 61 6c 28 30 2e 30 | 32 35 2c 6b 2c 6e 29 20 |mial(0.0|25,k,n) |
|00001b90| 69 73 20 61 20 39 37 2e | 35 25 20 63 6f 6e 66 69 |is a 97.|5% confi|
|00001ba0| 64 65 6e 63 65 20 6c 6f | 77 65 72 20 62 6f 75 6e |dence lo|wer boun|
|00001bb0| 64 20 6f 6e 20 70 0d 09 | 54 61 6b 65 6e 20 74 6f |d on p..|Taken to|
|00001bc0| 67 65 74 68 65 72 20 74 | 68 65 73 65 20 62 6f 75 |gether t|hese bou|
|00001bd0| 6e 64 73 20 66 6f 72 6d | 20 61 20 39 37 2e 35 25 |nds form| a 97.5%|
|00001be0| 2a 39 37 2e 35 25 3d 39 | 35 25 20 63 6f 6e 66 69 |*97.5%=9|5% confi|
|00001bf0| 64 65 6e 63 65 20 69 6e | 74 65 72 76 61 6c 3a 20 |dence in|terval: |
|00001c00| 5b 70 4c 6f 77 65 72 2c | 70 55 70 70 65 72 5d 2e |[pLower,|pUpper].|
|00001c10| 0d 09 2a 2f 0d 09 7b 0d | 09 23 69 66 20 30 0d 09 |..*/..{.|.#if 0..|
|00001c20| 09 72 65 74 75 72 6e 20 | 49 6e 76 65 72 73 65 49 |.return |InverseI|
|00001c30| 6e 63 6f 6d 70 6c 65 74 | 65 42 65 74 61 28 50 2c |ncomplet|eBeta(P,|
|00001c40| 6b 2c 6e 2d 6b 2b 31 29 | 3b 0d 09 23 65 6c 73 65 |k,n-k+1)|;..#else|
|00001c50| 0d 09 09 2f 2a 0d 09 09 | 54 68 69 73 20 73 69 6d |.../*...|This sim|
|00001c60| 70 6c 65 2d 6d 69 6e 64 | 65 64 20 62 69 73 65 63 |ple-mind|ed bisec|
|00001c70| 74 69 6f 6e 20 72 6f 75 | 74 69 6e 65 20 69 73 20 |tion rou|tine is |
|00001c80| 73 6c 6f 77 2c 20 62 75 | 74 20 69 74 73 20 61 6e |slow, bu|t its an|
|00001c90| 73 77 65 72 20 69 73 20 | 61 63 63 75 72 61 74 65 |swer is |accurate|
|00001ca0| 0d 09 09 74 6f 20 77 69 | 74 68 69 6e 20 b1 31 65 |...to wi|thin .1e|
|00001cb0| 2d 31 30 2e 20 0d 09 09 | 2a 2f 0d 09 09 64 6f 75 |-10. ...|*/...dou|
|00001cc0| 62 6c 65 20 6c 6f 77 3d | 30 2e 30 2c 68 69 67 68 |ble low=|0.0,high|
|00001cd0| 3d 31 2e 30 2c 6d 69 64 | 3b 0d 09 09 64 6f 75 62 |=1.0,mid|;...doub|
|00001ce0| 6c 65 20 66 3b 0d 09 09 | 69 6e 74 20 69 3b 0d 09 |le f;...|int i;..|
|00001cf0| 09 0d 09 09 66 6f 72 28 | 69 3d 30 3b 69 3c 33 30 |....for(|i=0;i<30|
|00001d00| 3b 69 2b 2b 29 7b 0d 09 | 09 09 6d 69 64 3d 28 6c |;i++){..|..mid=(l|
|00001d10| 6f 77 2b 68 69 67 68 29 | 2f 32 2e 30 3b 0d 09 09 |ow+high)|/2.0;...|
|00001d20| 09 66 3d 42 69 6e 6f 6d | 69 61 6c 28 6d 69 64 2c |.f=Binom|ial(mid,|
|00001d30| 6b 2c 6e 29 3b 0d 09 09 | 09 69 66 28 66 3e 50 29 |k,n);...|.if(f>P)|
|00001d40| 68 69 67 68 3d 6d 69 64 | 3b 0d 09 09 09 65 6c 73 |high=mid|;....els|
|00001d50| 65 20 6c 6f 77 3d 6d 69 | 64 3b 0d 09 09 7d 0d 09 |e low=mi|d;...}..|
|00001d60| 09 72 65 74 75 72 6e 20 | 28 6c 6f 77 2b 68 69 67 |.return |(low+hig|
|00001d70| 68 29 2f 32 2e 30 3b 0d | 09 23 65 6e 64 69 66 0d |h)/2.0;.|.#endif.|
|00001d80| 09 7d 0d 0d 09 64 6f 75 | 62 6c 65 20 49 6e 63 6f |.}...dou|ble Inco|
|00001d90| 6d 70 6c 65 74 65 42 65 | 74 61 28 64 6f 75 62 6c |mpleteBe|ta(doubl|
|00001da0| 65 20 78 2c 64 6f 75 62 | 6c 65 20 61 2c 64 6f 75 |e x,doub|le a,dou|
|00001db0| 62 6c 65 20 62 29 0d 09 | 2f 2a 0d 09 54 68 65 20 |ble b)..|/*..The |
|00001dc0| 69 6e 63 6f 6d 70 6c 65 | 74 65 20 62 65 74 61 20 |incomple|te beta |
|00001dd0| 66 75 6e 63 74 69 6f 6e | 20 49 78 28 61 2c 62 29 |function| Ix(a,b)|
|00001de0| 2e 0d 09 54 68 65 20 4e | 75 6d 65 72 69 63 61 6c |...The N|umerical|
|00001df0| 20 52 65 63 69 70 65 73 | 20 72 6f 75 74 69 6e 65 | Recipes| routine|
|00001e00| 20 61 73 73 75 6d 65 73 | 20 61 3e 30 2e 20 54 68 | assumes| a>0. Th|
|00001e10| 69 73 20 77 6f 72 6b 2d | 61 72 6f 75 6e 64 20 69 |is work-|around i|
|00001e20| 73 20 74 61 6b 65 6e 20 | 66 72 6f 6d 0d 09 41 62 |s taken |from..Ab|
|00001e30| 72 61 6d 6f 77 69 74 7a | 20 61 6e 64 20 53 74 65 |ramowitz| and Ste|
|00001e40| 67 75 6e 20 70 61 67 65 | 20 39 34 34 2c 20 45 71 |gun page| 944, Eq|
|00001e50| 2e 20 32 36 2e 35 2e 31 | 36 2e 0d 09 2a 2f 0d 09 |. 26.5.1|6...*/..|
|00001e60| 7b 0d 09 09 69 66 28 61 | 3e 30 2e 30 29 72 65 74 |{...if(a|>0.0)ret|
|00001e70| 75 72 6e 20 62 65 74 61 | 69 28 61 2c 62 2c 78 29 |urn beta|i(a,b,x)|
|00001e80| 3b 09 2f 2a 20 4e 75 6d | 65 72 69 63 61 6c 20 52 |;./* Num|erical R|
|00001e90| 65 63 69 70 65 73 20 69 | 6e 20 43 20 2a 2f 0d 09 |ecipes i|n C */..|
|00001ea0| 09 65 6c 73 65 20 72 65 | 74 75 72 6e 20 49 6e 63 |.else re|turn Inc|
|00001eb0| 6f 6d 70 6c 65 74 65 42 | 65 74 61 28 78 2c 61 2b |ompleteB|eta(x,a+|
|00001ec0| 31 2e 30 2c 62 29 0d 09 | 09 09 2b 65 78 70 28 67 |1.0,b)..|..+exp(g|
|00001ed0| 61 6d 6d 6c 6e 28 61 2b | 62 29 2d 67 61 6d 6d 6c |ammln(a+|b)-gamml|
|00001ee0| 6e 28 61 2b 31 2e 30 29 | 2d 67 61 6d 6d 6c 6e 28 |n(a+1.0)|-gammln(|
|00001ef0| 62 29 2b 61 2a 6c 6f 67 | 28 78 29 2b 62 2a 6c 6f |b)+a*log|(x)+b*lo|
|00001f00| 67 28 31 2e 30 2d 78 29 | 29 3b 0d 09 7d 0d 09 0d |g(1.0-x)|);..}...|
|00001f10| 09 64 6f 75 62 6c 65 20 | 49 6e 76 65 72 73 65 49 |.double |InverseI|
|00001f20| 6e 63 6f 6d 70 6c 65 74 | 65 42 65 74 61 28 64 6f |ncomplet|eBeta(do|
|00001f30| 75 62 6c 65 20 70 2c 64 | 6f 75 62 6c 65 20 61 2c |uble p,d|ouble a,|
|00001f40| 64 6f 75 62 6c 65 20 62 | 29 0d 09 2f 2a 0d 09 54 |double b|)../*..T|
|00001f50| 68 69 73 20 73 69 6d 70 | 6c 65 2d 6d 69 6e 64 65 |his simp|le-minde|
|00001f60| 64 20 62 69 73 65 63 74 | 69 6f 6e 20 72 6f 75 74 |d bisect|ion rout|
|00001f70| 69 6e 65 20 69 73 20 73 | 6c 6f 77 2c 20 62 75 74 |ine is s|low, but|
|00001f80| 20 69 74 73 20 61 6e 73 | 77 65 72 20 69 73 20 61 | its ans|wer is a|
|00001f90| 63 63 75 72 61 74 65 0d | 09 74 6f 20 77 69 74 68 |ccurate.|.to with|
|00001fa0| 69 6e 20 b1 31 65 2d 31 | 30 2e 20 0d 09 2a 2f 0d |in .1e-1|0. ..*/.|
|00001fb0| 09 7b 0d 09 09 64 6f 75 | 62 6c 65 20 66 2c 6c 6f |.{...dou|ble f,lo|
|00001fc0| 77 3d 30 2e 30 2c 68 69 | 67 68 3d 31 2e 30 2c 6d |w=0.0,hi|gh=1.0,m|
|00001fd0| 69 64 3b 0d 09 09 69 6e | 74 20 69 3b 0d 09 09 0d |id;...in|t i;....|
|00001fe0| 09 09 66 6f 72 28 69 3d | 30 3b 69 3c 33 30 3b 69 |..for(i=|0;i<30;i|
|00001ff0| 2b 2b 29 7b 0d 09 09 09 | 6d 69 64 3d 28 6c 6f 77 |++){....|mid=(low|
|00002000| 2b 68 69 67 68 29 2a 30 | 2e 35 3b 0d 09 09 09 66 |+high)*0|.5;....f|
|00002010| 3d 49 6e 63 6f 6d 70 6c | 65 74 65 42 65 74 61 28 |=Incompl|eteBeta(|
|00002020| 6d 69 64 2c 61 2c 62 29 | 3b 0d 09 09 09 69 66 28 |mid,a,b)|;....if(|
|00002030| 66 3e 70 29 68 69 67 68 | 3d 6d 69 64 3b 0d 09 09 |f>p)high|=mid;...|
|00002040| 09 65 6c 73 65 20 6c 6f | 77 3d 6d 69 64 3b 0d 09 |.else lo|w=mid;..|
|00002050| 09 7d 0d 09 09 72 65 74 | 75 72 6e 20 28 6c 6f 77 |.}...ret|urn (low|
|00002060| 2b 68 69 67 68 29 2a 30 | 2e 35 3b 0d 09 7d 0d 09 |+high)*0|.5;..}..|
|00002070| 0d 23 65 6e 64 69 66 0d | 00 00 00 00 00 00 00 00 |.#endif.|........|
|00002080| 00 00 01 00 00 00 02 6c | 00 00 01 6c 00 00 00 5e |.......l|...l...^|
|00002090| 70 79 72 69 67 68 74 20 | 28 63 29 20 31 39 39 30 |pyright |(c) 1990|
|000020a0| 20 44 65 6e 69 73 20 47 | 2e 20 50 65 6c 6c 69 0d | Denis G|. Pelli.|
|000020b0| 0a 42 69 6e 6f 6d 69 61 | 6c 2e 63 00 02 00 00 00 |.Binomia|l.c.....|
|000020c0| 50 61 72 74 53 49 54 21 | 00 00 00 00 00 00 00 00 |PartSIT!|........|
|000020d0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000020e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020f0| 00 00 ab bf ee 57 00 00 | 00 00 00 00 02 ca 0d 74 |.....W..|.......t|
|00002100| 68 65 20 75 6e 64 65 72 | 6c 79 69 6e 67 20 62 69 |he under|lying bi|
|00002110| 6e 6f 6d 69 61 6c 20 70 | 72 6f 62 61 62 69 6c 69 |nomial p|robabili|
|00002120| 74 79 20 61 73 73 75 6d | 65 64 20 74 6f 20 68 61 |ty assum|ed to ha|
|00002130| 76 65 20 67 65 6e 65 72 | 61 74 65 64 20 74 68 65 |ve gener|ated the|
|00002140| 20 64 61 74 61 2e 0d 54 | 72 61 6e 73 6c 61 74 65 | data..T|ranslate|
|00002150| 64 20 66 72 6f 6d 20 74 | 68 65 20 46 4f 52 54 52 |d from t|he FORTR|
|00002160| 41 4e 20 73 74 61 74 65 | 6d 65 6e 74 20 66 75 6e |AN state|ment fun|
|00002170| 63 74 69 6f 6e 73 20 69 | 6e 20 51 55 49 43 4b 32 |ctions i|n QUICK2|
|00002180| 00 00 00 1e 00 50 00 20 | 01 dd 02 3d 00 50 00 20 |.....P. |...=.P. |
|00002190| 01 dd 02 3d 00 00 0e c9 | 00 00 00 00 00 00 00 00 |...=....|........|
|000021a0| 00 00 00 00 00 f2 00 0a | 00 00 16 6e 00 00 16 76 |........|...n...v|
|000021b0| 09 42 69 6e 6f 6d 69 61 | 6c 00 00 00 0e 0e 00 00 |.Binomia|l.......|
|000021c0| 0e 20 13 42 69 6e 6f 6d | 69 61 6c 4c 6f 77 65 72 |. .Binom|ialLower|
|000021d0| 42 6f 75 6e 64 00 00 00 | 18 18 00 00 18 23 0b 42 |Bound...|.....#.B|
|000021e0| 69 6e 6f 6d 69 61 6c 50 | 64 66 00 00 04 cb 00 00 |inomialP|df......|
|000021f0| 04 d9 0f 42 69 6e 6f 6d | 69 61 6c 53 61 6d 70 6c |...Binom|ialSampl|
|00002200| 65 00 00 00 06 87 00 00 | 06 9c 15 42 69 6e 6f 6d |e.......|...Binom|
|00002210| 69 61 6c 53 61 6d 70 6c | 65 51 75 69 63 6b 6c 79 |ialSampl|eQuickly|
|00002220| 00 00 10 2c 00 00 10 3e | 13 42 69 6e 6f 6d 69 61 |...,...>|.Binomia|
|00002230| 6c 55 70 70 65 72 42 6f | 75 6e 64 00 00 00 1d 0c |lUpperBo|und.....|
|00002240| 00 00 1d 1a 0f 49 6e 63 | 6f 6d 70 6c 65 74 65 42 |.....Inc|ompleteB|
|00002250| 65 74 61 00 00 00 1a 1d | 00 00 1a 2c 0f 49 6e 76 |eta.....|...,.Inv|
|00002260| 65 72 73 65 42 69 6e 6f | 6d 69 61 6c 00 00 1e 98 |erseBino|mial....|
|00002270| 00 00 1e ad 15 49 6e 76 | 65 72 73 65 49 6e 63 6f |.....Inv|erseInco|
|00002280| 6d 70 6c 65 74 65 42 65 | 74 61 00 00 12 cd 00 00 |mpleteBe|ta......|
|00002290| 12 d1 05 6d 61 69 6e 00 | 00 00 00 48 00 09 4d 6f |...main.|...H..Mo|
|000022a0| 6e 61 63 6f 00 00 00 00 | 00 00 00 00 00 00 00 00 |naco....|........|
|000022b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 03 |........|........|
|000022c0| 00 04 00 3d 00 03 01 a0 | 02 7d 00 3d 00 03 01 a0 |...=....|.}.=....|
|000022d0| 02 7d ab 31 05 f1 00 00 | 00 00 00 00 00 02 00 00 |.}.1....|........|
|000022e0| 00 00 00 00 00 00 00 04 | 00 01 00 01 00 00 01 00 |........|........|
|000022f0| 00 00 02 6c 00 00 01 6c | 00 00 00 5e 00 b8 5c 88 |...l...l|...^..\.|
|00002300| 3a 06 00 00 00 1c 00 5e | 00 01 4d 50 53 52 00 02 |:......^|..MPSR..|
|00002310| 00 12 4d 57 42 42 00 00 | 00 36 03 f0 ff ff 00 00 |..MWBB..|.6......|
|00002320| 00 00 00 00 00 00 03 ef | ff ff 00 00 00 22 00 00 |........|....."..|
|00002330| 00 00 03 ed ff ff 00 00 | 01 18 00 00 00 00 03 f0 |........|........|
|00002340| ff ff 00 00 01 64 00 00 | 00 00 00 00 00 00 00 00 |.....d..|........|
|00002350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+